package com.supor.aiot.common.utils;

import android.content.Context;
import android.graphics.drawable.Drawable;

import com.android.baseconfig.base.GlideApp;
import com.android.baseconfig.base.GlideRequest;
import com.supor.aiot.common.R;

/**
 * @author: zook
 * @date: 2021/11/9
 */
public class UserAvaUtils {
    public static GlideRequest<Drawable> getAvaRequest(Context mContext, String avaPath) {
        GlideRequest<Drawable> glideRequests;
        String avaStr = NotNullUtils.getNotNullValue(avaPath, "0");
        switch (avaStr) {
            case "0":
                glideRequests = GlideApp.with(mContext).load(R.mipmap.ic_default_head);
                break;
            case "1":
                glideRequests = GlideApp.with(mContext).load(R.mipmap.ic_default_head1);
                break;
            case "2":
                glideRequests = GlideApp.with(mContext).load(R.mipmap.ic_default_head2);
                break;
            case "3":
                glideRequests = GlideApp.with(mContext).load(R.mipmap.ic_default_head3);
                break;
            case "4":
                glideRequests = GlideApp.with(mContext).load(R.mipmap.ic_default_head4);
                break;
            default:
                glideRequests = GlideApp.with(mContext).load(avaStr);
                break;
        }
        return glideRequests;
    }
}
